package com.xhtt.modules.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhtt.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 系统用户
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2016年9月18日 上午9:34:11
 */
@Mapper
public interface SysUserDao extends BaseMapper<SysUserEntity> {

    /**
     * 查询用户的所有权限
     *
     * @param userId 用户ID
     */
    List<String> queryAllPerms(Long userId);

    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    List<SysUserEntity> queryUserPage(Page<SysUserEntity> page, @Param(value = "ps") Map<String, Object> params);

    List<SysUserEntity> queryWorkUserPage(Page<SysUserEntity> page, @Param(value = "ps") Map<String, Object> params);

    List<SysUserEntity> zhuangcheTempTeamUser(@Param(value = "teamId") Integer teamId, @Param(value = "loadAreaType") Integer loadAreaType);

    SysUserEntity getTeamLeader(@Param(value = "teamId") Integer teamId);

    SysUserEntity getTeamLeaderByUser(@Param(value = "userId") Integer userId);

    List<SysUserEntity> listByDept(Page<SysUserEntity> page, @Param(value = "deptId") Integer deptId);

    List<SysUserEntity> listByTeam(Page<SysUserEntity> page, @Param(value = "deptId") Integer deptId);

    List<SysUserEntity> getDeptLeaderByTeam(@Param(value = "teamId") Integer teamId);

    List<SysUserEntity> getDeptLeaderByDept(@Param(value = "deptId") Integer deptId);

    String getUserWithDept(@Param(value = "userId") Integer userId);

    int getZCZCount(@Param(value = "userIds") Set userIds, @Param(value = "zcz") String zcz);
}
